import request from "@/utils/request";

// 查询CTF实验环境列表
export function listCtfenvironment(query) {
  return request({
    url: "/experiment/ctfenvironment/list",
    method: "get",
    params: query,
  });
}

// 查询CTF实验环境详细
export function getCtfenvironment(ctfEnvironmentId) {
  return request({
    url: "/experiment/ctfenvironment/" + ctfEnvironmentId,
    method: "get",
  });
}

// 新增CTF实验环境
export function addCtfenvironment(data) {
  return request({
    url: "/experiment/ctfenvironment",
    method: "post",
    data: data,
  });
}

// 修改CTF实验环境
export function updateCtfenvironment(data) {
  return request({
    url: "/experiment/ctfenvironment",
    method: "put",
    data: data,
  });
}

// 删除CTF实验环境
export function delCtfenvironment(ctfEnvironmentId) {
  return request({
    url: "/experiment/ctfenvironment/" + ctfEnvironmentId,
    method: "delete",
  });
}

//生成环境实例
export function addEnvironmentExample(ctfEnvironmentId) {
  return request({
    url: "/experiment/ctfenvironment/addExample/" + ctfEnvironmentId,
    method: "post",
  });
}
